//
//  GroupListViewController.h
//  MapLink
//
//  Created by heng zhang on 21/05/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIViewPassValueDelegate.h"

// meng - declare ViewControllers instead of import here
@class GroupListViewController;
@class UserConfigViewController;
@class UserGroupMapViewController;
@class GroupRegViewController;
@class AppConfig;
@class EntityManager;

@interface GroupListViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, UIViewPassValueDelegate> {
	UserConfigViewController *userConfigViewController;
	GroupRegViewController *groupRegViewController;
	UserGroupMapViewController *mapViewController;
	
	NSMutableArray *groups;
	NSString *displayName;
	NSString *deviceID;
	NSString *groupName;
	NSMutableData *buffer;
	NSURLConnection *conn;
	
	// meng config object
	AppConfig *appConfig;
	EntityManager *entityMgr;
	
	
	
	
	
	IBOutlet UITableView *groupTableView;
	IBOutlet UIToolbar *toolbar;
	IBOutlet UIActivityIndicatorView *activityIndicatorView;
}
@property (nonatomic, retain) NSMutableData *buffer;
-(IBAction) goProfile;
-(IBAction) goJoin;
-(void) unjoinGroup:(NSString *)name;
-(void) loadGroupsFromDB;
-(BOOL) addGroupToDB:(NSString *)name;
-(BOOL) deleteGroupFromDB:(NSString *)name;



@end
